all: test_echo test_sha256 test_rc4 test_lzss exploit_v0

test_echo:
	rm -rf test_echo
	/home/jdub/x-tools/mipsel-unknown-elf/bin/mipsel-unknown-elf-gcc -O1 -nostdlib -nostdinc -nodefaultlibs -march=r3000 echo_test.c -o test_echo
	../sign_tool/mep_converter test_echo test_echo.meb ../sign_tool/priv.key

test_sha256:
	rm -rf test_sha256
	/home/jdub/x-tools/mipsel-unknown-elf/bin/mipsel-unknown-elf-gcc -O1 -nostdlib -march=r3000 sha256.c test_sha256.c -o test_sha256
	../sign_tool/mep_converter test_sha256 test_sha256.meb ../sign_tool/priv.key

test_rc4:
	rm -rf test_rc4
	/home/jdub/x-tools/mipsel-unknown-elf/bin/mipsel-unknown-elf-gcc -O1 -nostdlib -march=r3000 test_rc4.c -o test_rc4
	../sign_tool/mep_converter test_rc4 test_rc4.meb ../sign_tool/priv.key

test_lzss:
	rm -rf test_lzss
	/home/jdub/x-tools/mipsel-unknown-elf/bin/mipsel-unknown-elf-gcc -O2 -nostdlib -march=r3000 test_lzss.c -o test_lzss
	../sign_tool/mep_converter test_lzss test_lzss.meb ../sign_tool/priv.key

exploit_v0:
	rm -rf test_exploit_v0
	/home/jdub/x-tools/mipsel-unknown-elf/bin/mipsel-unknown-elf-gcc -O1 -nostdlib -fPIC -mabicalls -march=r3000 test_exploit_v0.c -o test_exploit_v0 
	../sign_tool/mep_converter test_exploit_v0 test_exploit_v0.meb ../sign_tool/priv.key

clean:
	rm -rf test_echo test_sha256 test_rc4 test_lzss test_exploit_v0
